#include<bits/stdc++.h>
using namespace std;
const int N=100000;
int n,cnt[N+5];
int main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    cin>>n;
    for(int i=1;i<=n;i++){
        int x;cin>>x;
        cnt[x]++;
    }
    int sum=0,ans=n;
    for(int i=1;i<=N;i++){
        if(!cnt[i])continue;
        if(!sum){
            sum=cnt[i];
            continue;
        }
        if(cnt[i]>sum){
            ans-=sum;
            sum=cnt[i];
        }
        else{
            ans-=cnt[i];
        }
    }
    cout<<ans<<endl;
    return 0;
}//100
